package com.zhkj.crawl.config;

/**
 * Amazon站点配置 以下按OMS11月单量降序
 */
public enum AmzSiteParamEnum {
    US("美国", "Best Sellers Rank", "https://www.amazon.com/"),
    UK("英国", "Best Sellers Rank", "https://www.amazon.co.uk/"),
    GB("英国", "Best Sellers Rank", "https://www.amazon.co.uk/"),
    DE("德国", "Amazon Bestseller-Rang;Best Sellers Rank", "https://www.amazon.de/"),
    FR("法国", "Classement des meilleures ventes d'Amazon", "https://www.amazon.fr/"),
    CA("加拿大", "Best Sellers Rank", "https://www.amazon.ca/"),
    ES("西班牙", "Clasificación en los más vendidos de Amazon", "https://www.amazon.es/"),
    IT("意大利", "Posizione nella classifica Bestseller di Amazon", "https://www.amazon.it/"),
    JP("日本", "Amazon Bestseller;亚马逊热销商品排行榜;Amazon 売れ筋ランキング", "https://www.amazon.co.jp/"),
    NL("荷兰", "Plaats in bestsellerlijst", "https://www.amazon.nl/"),
    BR("巴西", "Ranking dos mais vendidos", "https://www.amazon.com.br/"),
    AU("澳大利亚", "Best Sellers Rank", "https://www.amazon.com.au/"),
    MX("墨西哥", "Clasificación en los más vendidos de Amazon", "https://www.amazon.com.mx/"),
    SE("瑞典", "Rangordning för bästsäljare", "https://www.amazon.se/"),
    PL("波兰", "Ranking najlepiej sprzedających się produktów", "https://www.amazon.pl/"),
    SG("新加坡", "Best Sellers Rank","https://www.amazon.sg/"),
    ;
    public final String siteName;
    public final String keywordRank;
    public final String siteUrl;

    AmzSiteParamEnum(String siteName, String keywordRank, String siteUrl) {
        this.siteName = siteName;
        this.keywordRank = keywordRank;
        this.siteUrl = siteUrl;
    }

    public static AmzSiteParamEnum getByCountryCode(String code){
        if(code != null){
            for (AmzSiteParamEnum value : values()) {
                if(value.name().equalsIgnoreCase(code)){
                    return value;
                }
            }
        }
        return null;
    }
}
